]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
appDisplay: Implement folder keynav and shortcuts
authorFlorian Müllner <fmuellner@gnome.org>
Wed, 6 Mar 2013 20:42:36 +0000 (21:42 +0100)
committerFlorian Müllner <fmuellner@gnome.org>
Mon, 13 May 2013 17:41:23 +0000 (19:41 +0200)
When opening an application folder, it should take key focus to
allow for keynav; also, Escape closing both folder and app picker
is unexpected, it should only close the popup.

https://bugzilla.gnome.org/show_bug.cgi?id=695314

js/ui/appDisplay.js

index bcfb57a2c21f5fd02d97fe7063caf5e5568bf381..afeecc17f20a2fd442623ad868a5aa9e6fda38a9 100644 (file)
@@ -627,10 +627,24 @@ const AppFolderPopup = new Lang.Class({
         this._boxPointer.actor.bind_property('opacity', closeButton, 'opacity',
                                              GObject.BindingFlags.SYNC_CREATE);
 
+        global.focus_manager.add_group(this.actor);
+
         source.actor.connect('destroy', Lang.bind(this,
             function() {
                 this.actor.destroy();
             }));
+        this.actor.connect('key-press-event', Lang.bind(this, this._onKeyPress));
+    },
+
+    _onKeyPress: function(actor, event) {
+        if (!this._isOpen)
+            return false;
+
+        if (event.get_key_symbol() != Clutter.KEY_Escape)
+            return false;
+
+        this.popdown();
+        return true;
     },
 
     toggle: function() {
@@ -645,6 +659,7 @@ const AppFolderPopup = new Lang.Class({
             return;
 
         this.actor.show();
+        this.actor.navigate_focus(null, Gtk.DirectionType.TAB_FORWARD, false);
 
         this._boxPointer.setArrowActor(this._source.actor);
         this._boxPointer.show(BoxPointer.PopupAnimation.FADE |